home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / c-runtime / tests / RCS / error.m,v < prev    next >
Encoding:
Text File  |  1992-08-18  |  1.0 KB  |  74 lines

  1. head    1.1;
  2. access;
  3. symbols;
  4. locks
  5.     dglattin:1.1; strict;
  6. comment    @# @;
  7.  
  8.  
  9. 1.1
  10. date    92.08.18.04.58.04;    author dglattin;    state Exp;
  11. branches;
  12. next    ;
  13.  
  14.  
  15. desc
  16. @test code.
  17. @
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @#include  <Object.h>
  26. #include  <stdio.h>
  27.  
  28.  
  29. @@interface SubClass1 : Object {}
  30. + ( int )return12;
  31. - ( int )return15;
  32. @@end
  33.  
  34. @@implementation SubClass1
  35. + ( int )return12 { return 12; }
  36. - ( int )return15 { return 15; }
  37. @@end
  38.  
  39.  
  40.  
  41. @@interface SubClass4 : SubClass1 {}
  42. + ( int )return12;
  43. - ( int )return15;
  44. @@end
  45.  
  46. @@implementation SubClass4
  47. + ( int )return12 { 
  48.  
  49.                             /* Due to compiler design, 
  50.                               this should not be a infinite loop. */
  51.   [ SubClass1 new ];    
  52.   [ SubClass4 new ];    
  53.   return [ super return12 ] + 1 ; 
  54. }
  55.  
  56.  
  57. - ( int )return15 { 
  58.  
  59.  
  60.   [ SubClass1 new ];    /* Due to compiler design, 
  61.                               this should not be a infinite loop. */
  62.   return [ super return15 ]; 
  63. }
  64. @@end
  65.  
  66.  
  67.  
  68. void  main (void) {
  69.  
  70.  
  71.   [ SubClass4 poseAs:[ SubClass1 class ]];
  72.   printf ("%d\n", [ SubClass4 return12 ]);
  73. }@
  74.